<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*,java.text.*"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<link href="../../../css/btn.css" rel="stylesheet" type="text/css" />
<link href="../../../css/form.css" rel="stylesheet" type="text/css" />
<link href="../../../css/login.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.form1 {width:300px;}
-->
</style>
<body>

            <%
           /*
           *验证权限
           *author 宋智洋
           *data 2011-11-26
           *update 胡瑾
           *data 2011-12-01
           *增加了userId
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int studentId = Integer.parseInt(userId);
						
			if (flag != "student"|| flag==null )
			{
				%>
<script language="javascript">
				     alert("您没有学生权限,请重新登录"); window.location.href="../../index.jsp";
				    </script>
            <%
				
			}else{
				Student student = new Student();
				StudentControl sc = new StudentControl();
				student = sc.GetStudent(studentId);
				out.print("<p>"+student.getStudentName()+"   欢迎您</p>");
			}
           %>
           
          <%
		int k = 0;
		request.setCharacterEncoding("utf-8");
		int pages = ParamUtil.getInt(request,"pages",1);
		int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	    Answerlog answerlog = new Answerlog();
	   // Answerlog answerlog2 = new Answerlog();
		AnswerlogControl alc = new AnswerlogControl();
	
		List<Answerlog>list = new ArrayList<Answerlog>();
		list = (List)alc.GetAnswerlog();

%>

<p>请选择一个时间进行查看</p>
  <form action="problem_history_list.jsp" method = "post" name="form" class="form1">
     <select name="testTime">
<%
        /*判重
        *陈星
		*2011-12-08
		*/
		others o = new others();
		//System.out.println("begin");
		o.InitVtr();
		for(int i = 0; i<list.size();i++)
		{
			answerlog = list.get(i);
			String tmpStr = answerlog.getTestTime();
			int tmp = o.hashStringToInt(tmpStr);
			boolean IsOk = o.InsertVtr(tmp, tmpStr);
			if(IsOk == true &&answerlog.getStudentId() == studentId) {
%>
               <option value="<%=answerlog.getTestTime()%>"><%=answerlog.getTestTime() %></option>
               <%
			}//if
	    } //for
%>
    </select>
            <BUTTON type="submit" class="btn-blue" id="btn-login">确定</BUTTON>
</form>

       
</html>
